<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
	</head>
	<body>
		<button id="btn1">按钮一</button>
		<button id="btn2">按钮二</button>
		<button onclick="demo()">按钮三</button>

		<script type="text/javascript" >
			const btn1 = document.getElementById('btn1')
			const btn2 = document.getElementById('btn2')

			btn1.addEventListener('click',function(event){
				console.log(event)
				// alert('按钮一被点击了')
				// console.log(event.target)
			})

			btn2.onclick = function(){
				alert('按钮二被点击了')
			}

			function demo(){
				alert('按钮三被点击了')
			}
		</script>
	</body>
</html>